package org.ch02.hw.demo07;

import java.util.Map;

/**
 * @author ZJL
 * @date 2025-03-18
 */
public class User {
    private int id;
    private String name;
    public User() {

    }
    public User(int id, String name) {
        this.id = id;
        this.name = name;
    }
    public User(Map<String, Object> map) {
        this.id = (Integer) map.get("id");
        this.name = (String) map.get("name");
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}

